<?php

abstract class Soul_Collection_Enumerator implements Iterator{

    protected $source = NULL;

    protected function __construct($source = array()){
        $this->source = $source;
    }
    
    public function toArray(){
    	return $this->source;
    }

    public function current() {
        return current($this->source);
    }

    public function key() {
        return key($this->source);
    }

    public function next() {
        next($this->source);
    }
    
    public function rewind() {
        reset($this->source);
    }

    public function valid() {
        return current($this->source) !== FALSE;
    }
    
    public function isEmpty(){
        return count($this->source) == 0;
    }    
}